Administration System
Code Extensions
Code Extensions view
Extension form
The Extension form enables you to add a new code extension or edit an existing code extension.
System-seeded code extensions, that is, code extensions that are provided by N4, cannot be edited or deleted. However, you can use the Extension form to view and copy the contents of a system-seeded code extension so that you can create a customized code extension -- also referred to as a code extension override -- according to your requirements.
Prerequisites
In order to add, edit, or delete a code extension, your broadest scope level, as defined in your User form, must be at the Operator level.
To add or edit a code extension:
From the Level drop-down list, select the scope level at which you want to define the code extension.
You can define a code extension only at the global scope level or at the operator scope level. The scope levels available in the Level drop-down list depend on the broadest scope level for your user ID.
If you selected Operator in step 1, from the Scope drop-down list, select the operator for which you want to add the code extension.
If you selected Global in step 1, N4 displays the Scope drop-down list as a view-only field.
From the Extension Type drop-down list, select the type of code extension you want to add.
For a list of code extensions available in N4, see the Extension Type Registry view (on page 1).
If you select an Optimization code extension type, OPT_CONFIGURATION_PROVIDER, OPT_DATA_PROVIDER, OPT_RESULT_HANDLER, OPT_SOLVE_STRATEGY, N4 adds the Problem Type field to the form.
To associate a problem type with the code extension, select a Problem Type in the Excluded box and click to move the problem type to the Included box.
To see a problem type in the Excluded box and associate it with a code extension, you must have the required privilege for the problem type. For a complete list of the system-seeded problem types and the associated privilege, see System-seeded Problem Types.
If you add any custom problem types, they are not associated with a privilege or a feature and are always available in this list. For more information, see Problem Types and Code Extensions
In the Code Extension Name field, enter a name that uniquely identifies the code extension for the selected scope. Use up to 40 characters.
From the Extension Language field, select the programming language you want to use to write the code extension.
Select the class that this class Extends. If this Groovy class is extending another Groovy class, then you must choose the dependent Groovy class in the drop-down list so that the Groovy classes are uploaded in the correct order. Failing to do so may result in a Groovy error "unable to resolve class XXXX".
The Is Enabled check box is selected by default. You can clear this check box if you want to disable a code extension.
If you disable a code extension, N4 does not execute the code extension.
In the Extension Contents field, you can either click the Import Extension File button to import the code from an existing file or copy and paste the code.
Initially, N4 displays the contents of the Extension Contents field as view-only. To edit the contents of an imported file or to copy and paste code in the Extension Contents field, first click the Edit Contents button.
Edit the contents as required.
Optionally, in the Extension Description field, enter a brief description that describes the purpose of the code extension.
Click Save.
N4 validates the code. If there are no errors, N4 saves the code extension.